package cn.db101.jcc.controller;

import cn.db101.jcc.model.ResultModel;
import cn.db101.jcc.service.BannerService;
import cn.db101.jcc.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zooy
 * @create 2024-06-11 1:40
 * @description
 */
@RestController
@RequestMapping("v1/jcc/index")
public class IndexController {

    @Autowired
    private BannerService bannerService;

    @Autowired
    private NewsService newsService;

    @GetMapping("banner/list")
    public ResultModel bannerList() {

        return ResultModel.success(bannerService.bannerList());
    }

    @GetMapping("news/list")
    public ResultModel newsList() {

        return ResultModel.success(newsService.newsList());
    }

}
